/**
 * Copyright 2010 Pavel Daniel Alexandru PFA
 * 
 * Licensed under the terms of the GNU Lesser General Public License version 3 
 * as published by the Free Software Foundation. You may obtain a copy of the
 * License at: http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations 
 * under the License. 
 */
package com.kobol.webclient.client.settings.view;

import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.ViewImpl;
import com.kobol.webclient.client.data.AdministrationContextAreaSectionData;
import com.kobol.webclient.client.settings.presenter.AdministrationPresenter;
import com.smartgwt.client.widgets.layout.VLayout;

/**
 * @author Pavel Alexandru
 * 
 */
public class AdministrationView extends ViewImpl implements AdministrationPresenter.MyView {

    private static final String CONTEXT_AREA_WIDTH = "*";

    private final SettingsContextAreaListGrid listGrid;

    private VLayout panel;

    @Inject
    public AdministrationView(SettingsContextAreaListGrid listGrid) {

	Log.debug("AdministrationView()");

	this.listGrid = listGrid;
	this.listGrid.setData(AdministrationContextAreaSectionData.getRecords());

	panel = new VLayout();

	// initialise the AdministrationView layout container
	panel.setStyleName("crm-ContextArea");
	panel.setWidth(CONTEXT_AREA_WIDTH);

	// add the List Grid the AdministrationView layout container
	panel.addMember(this.listGrid);
    }

    @Override
    public Widget asWidget() {
	return panel;
    }
}
